package com.wish.g04.financing.service.impl;

import com.wish.g04.base.entity.CwDealPerDay;
import com.wish.g04.financing.dto.DealPerDayDTO;
import com.wish.g04.financing.dto.DealPerDayDetailsDTO;
import com.wish.g04.financing.mapper.DealPerDayMapper;
import com.wish.g04.financing.service.DealPerDayService;
import com.wish.g04.financing.vo.DealPerDayTotalVO;
import com.wish.g04.financing.vo.DealPerDayDetailsVO;
import com.wish.g04.financing.vo.PaymentPlanTotalVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 营业报表
 * @author tyd
 * @since 2022-05-29
 */
@Service
public class DealPerDayServiceImpl  implements DealPerDayService {

    @Autowired
    private DealPerDayMapper dealPerDayMapper;


    /**
     * 查询营业报表信息
     * @param dealPerDayDTO
     * @return
     */
    @Override
    public List<CwDealPerDay> getDealPerDayList(DealPerDayDTO dealPerDayDTO) {
        return dealPerDayMapper.getDealPerDayList(dealPerDayDTO);
    }

    /**
     * 统计总额
     * @param dealPerDayDTO
     * @return
     */
    @Override
    public DealPerDayTotalVO getDealPerDaySum(DealPerDayDTO dealPerDayDTO) {
        return dealPerDayMapper.getDealPerDaySum(dealPerDayDTO);
    }

    /**
     * 查询收入明细的详情
     * @param dealPerDayDetailsDTO
     * @return
     */
    @Override
    public List<DealPerDayDetailsVO> getReceiptPlanList(DealPerDayDetailsDTO dealPerDayDetailsDTO) {
        return dealPerDayMapper.getReceiptPlanList(dealPerDayDetailsDTO);
    }

    /**
     * 统计某天的收入总额
     * @param receiptPlanDTO
     * @return
     */
    @Override
    public BigDecimal getReceiptPlanSum(DealPerDayDetailsDTO receiptPlanDTO) {
        return dealPerDayMapper.getReceiptPlanSum(receiptPlanDTO);
    }

    /**
     * 查询支出明细的详情
     * @param dealPerDayDetailsDTO
     * @return
     */
    @Override
    public List<DealPerDayDetailsVO> getPaymentPlanList(DealPerDayDetailsDTO dealPerDayDetailsDTO) {
        return dealPerDayMapper.getPaymentPlanList(dealPerDayDetailsDTO);
    }

    /**
     * 统计某天的支出总额明细
     * @param dealPerDayDetailsDTO
     * @return
     */
    @Override
    public PaymentPlanTotalVO getPaymentPlanSum(DealPerDayDetailsDTO dealPerDayDetailsDTO) {
        return dealPerDayMapper.getPaymentPlanSum(dealPerDayDetailsDTO);
    }
}
